function insertQue1(temp){
    const sqlite3 = require("sqlite3").verbose()
    const path = require('path');
    const dbName = path.join(__dirname, '../data/demo.db');
    var db;
    db = new sqlite3.Database(dbName,function(err){
        if(err) throw err;
    })
    for(var i=0;i<6;i++){
        db.run(`update qone set score = ? WHERE e_id=? AND c_id=?`,temp[i].score,temp[i].e_id,temp[i].c_id,function(err){
            if (err) throw err;
            console.log('插入成功')
        })
    }
    for(var i=0;i<6;i++){
        db.run(`UPDATE cafe SET q1ave=(SELECT AVG(score) FROM qone WHERE c_id=?) WHERE c_id=?`,i+1,i+1,function(err) {
            if (err) throw err;
        })
    }
}
module.exports=insertQue1;